﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SystemCenterSoa.ApiProject.Area.SystemManager;
using SystemCenterSoa.DtoModel.Common;
using SystemCenterSoa.PoModel.SystemSettings.CommonlyUsedSettings;
using SystemCenterSoa.Service.SystemSettings.CommonlyUsedSettings;

namespace SystemCenterSoa.ApiProject.Area.SystemSettings.CommonlyUsedSettings
{
    [AllowAnonymous]  //不验证登录
    public class BuildingTitleController : SystemManagerBaseController
    {
        private BuildingTitleService _buildingTitleService;

        public BuildingTitleController(BuildingTitleService buildingTitleService)
        {
            _buildingTitleService = buildingTitleService;
        }

        [HttpPost]
        public ResultModel<int> BuildingTitleAdd(BuildingTitlePo info)
        {
            var data=_buildingTitleService.BuildingTitleAdd(info);
            return MyOk(data);
        }
        [HttpGet]
        public ResultModel<BuildingTitlePo> BuildingTitleEdit(int id)
        {
            var data=_buildingTitleService.BuildingTitleEdit(id);
            return MyOk(data);
        }

        [HttpPost]
        public ResultModel<int> BuildingTitlePoDelete(List<int> ids)
        {
            var data = _buildingTitleService.BuildingTitlePoDelete(ids);
            return MyOk(data);
        }

        [HttpPost]
        public ResultModel<int> BuildingTitlePoUpdate(BuildingTitlePo info)
        {
            var data=_buildingTitleService.BuildingTitlePoUpdate(info);
            return MyOk(data);
        }

        [HttpGet]
        public ResultModel<List<BuildingTitlePo>> GetBuildingTitleAll(string name)
        {
            var data=_buildingTitleService.GetBuildingTitleAll(name);
            return MyOk(data);
        }

    }
}
